{extend name="public:base"}
{block name='css'}
<link href="__PUBLIC__/css/plugins/iCheck/custom.css" rel="stylesheet">
{/block}
{block name="js"}
<script src="__PUBLIC__/js/plugins/peity/jquery.peity.min.js"></script>
<script src="__PUBLIC__/js/content.min.js?v=1.0.0"></script>
{/block}
{block name='body'}
<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">

        <div class="row">
            <div class="col-sm-12">
                <div class="ibox float-e-margins">
                    <div class="ibox-title">
                        <h5>{$title|default=''}推广的用户</h5>
                    </div>
                    <div class="ibox-content">
						<div class="row">
							<form name="form" action="{:url('index')}" method="get">
                                <input type="hidden" name="pid" value="{:input('pid', '', 'trim')}">
                                <div class="col-sm-2 m-b-xs">
                                    <select name="type" class="input-sm  form-control">
                                        <option value="-1">用户类型</option>
                                        {volist name="typeList" id="vo"}
                                        <option value="{$key}" {if condition="input('type', -1, 'intval') eq $key"} selected {/if} >{$vo}</option>
                                        {/volist}
                                    </select>
                                </div>
                                <div class="col-sm-4 m-b-xs">
                                    <div class="input-group">
                                        <input type="text" name="keywords" placeholder="姓名/电话" value="{:input('keywords', '', 'trim')}" class="input-sm form-control">
                                        <span class="input-group-btn">
                                            <button type="submit" class="btn btn-sm btn-primary"> 搜索</button>
                                        </span>
                                    </div>
                                </div>
							</form>
                        </div>
                        <table class="table table-hover">
                            <thead>
                                <tr>
                                    <th>上级</th>
                                    <th>用户类型</th>
                                    <th>姓名</th>
                                    <th>手机号</th>
                                    <th>邀请码</th>
                                    <th>余额</th>
                                    <th>钱包</th>
                                    <th>推广人数</th>
                                    <th>注册时间</th>
                                    <th>操作</th>
                                </tr>
                            </thead>
                            <tbody>
								{foreach name="list" item="li"}
                                <tr>
                                    <td>{$li.p_user|default='-'}</td>
                                    <td>{$typeList[$li.user_type]}</td>
                                    <td>{$li.name|default=''}</td>
                                    <td>{$li.tel|default=''}</td>
                                    <td>{$li.code|default=''}</td>
                                    <td>￥{$li.balance|default=''}</td>
                                    <td>￥{$li.jbalance|default=''}</td>
                                    <td><a href="javascript:;" onclick="showSons(this, {$li.id});" class="btn btn-info btn-xs">{$li.has_son|default=0}</a></td>
                                    <td>{$li.add_time|date="Y-m-d H:i:s",###}</td>
                                </tr>
								{/foreach}
                            </tbody>
							<tfoot>
								<tr>
                                    <td colspan="20">
										<div class="zy_page">{$list->render()}</div>
									</td>
                                </tr>
							</tfoot>
                        </table>
                    </div>
                </div>
            </div>
        </div>

    </div>
</body>
{/block}
